{{:main}}
{{?q.actions}}
	{{!connect "quest/doc.js"}}
	{{!connect "theme/quest/votes.css" media="screen" charset="utf-8"}}
	<div class="votes-buttons">
		{{!for q.actions do=@:quest_btn}}
		{{!for q.cur_balls do=@:cur_balls_btn}}
	</div>
	<div class="votes-clear"></div>
	{{!for q.actions do=@:quest_container}}
{{/?}}
{{/:main}}

{{:quest_btn}}
<img onclick="showQuestAction({{*id}},{{doc_id}},this)" src="{{images}}quest/votes-ico-{{*btn_n}}.gif" alt="+" class="submit-" />
{{/:quest_btn}}

{{:cur_balls_btn}}
<div class="votes-ball-{{*btn_n}}">
	<div class="">
		<div class="">
			{{*balls}}
		</div>
	</div>
</div>
{{/:cur_balls_btn}}

{{:quest_container}}
<div id="vote_container_{{doc_id}}_{{*id}}" style="display: none;" class="votes-window">{{*action_url}}</div>
{{/:quest_container}}

{{:show_quest}}
{{?!is_quest}}<div class="votes-window-header">На конкурс: </div>
<div class="votes-window-name"><a href="{{q.url}}">{{q.title}}</a></div>{{/?}}
<div class="votes-col-3">{{?q.actions.vote}}А вот и ваше мнение:{{/?}}</div>
<div class="votes-col-3">{{?q.actions.cur_votes}}{{q.cur_count}} мнени{{?q.cur_count_padej==1}}е{{/?}}{{?q.cur_count_padej==2}}я{{/?}}{{?q.cur_count_padej==3}}й{{/?}}:{{/?}}</div>
<div class=""></div>
<div class="votes-clear"></div>
{{?q.actions.vote || q.actions.cur_votes}}{{@:quest_vote votes=q.votes}}{{/?}}
{{?q.actions.add || q.actions.vote_ok}}
<input type="hidden" id="doc_action_actions_{{d.id}}_{{q.id}}" value="{{?q.actions.add}}a{{/?}}{{?q.actions.vote_ok}}v{{/?}}">
<img src="{{images}}quest/votes-button_{{?q.actions.add}}a{{/?}}{{?q.actions.vote_ok}}v{{/?}}.gif" alt="" title="" onclick="onQuestAction({{q.id}},{{d.id}})"/>
{{/?}}
{{/:show_quest}}

{{:quest_vote}}
{{!for votes do=@:quest_votes}}
{{:quest_votes}}
<div class="votes-col-3">
{{?q.actions.vote}}
	{{?*method==1}}{{@:vote_binar v=*}}{{/?}}
	{{?*method==2}}{{?*var_count>5}}{{@:vote_scale_num v=*}}{{?:}}{{@:vote_scale_zvezd v=*}}{{/?}}{{/?}}
	{{?*method==3}}{{@:vote_scale v=*}}{{/?}}
	{{?*method==4}}{{@:vote_categories v=*}}{{/?}}
	{{?*method==5}}{{@:vote_categories v=*}}{{/?}}
	{{?*method==6}}{{@:vote_comment v=*}}{{/?}}
{{/?}}
</div>
<div class="votes-col-3">
{{?q.actions.cur_votes}}
	{{?*method==2 && *var_count<=5}}
	{{@:cur_scale_zvezd v=*cur.variants}}
	{{?:}}
	{{*cur.val}}
	{{/?}}
{{/?}}
</div>
<div class="votes-window-nomi">{{*name}}</div>
<div class="votes-clear"></div>
{{/:quest_votes}}
{{/:quest_vote}}

{{:vote_binar}}
<input type="checkbox" value="1" class="quest_vote_{{q.id}} vi_{{v.id}}">
{{/:vote_binar}}

{{:vote_scale_zvezd}}{{v.is_voted!}}
{{!for v.variants do=@:vote_scale_variants_zv}}
{{:vote_scale_variants_zv}}
{{?v.is_voted!=1}}
<img onmouseover="zvezdaOn(this)" onmouseout="zvezdaOff(this)" class="ai vote_item_{{q.id}}_{{v.id}} vote_val_{{*value}}" onclick="onSelectVoteZv({{q.id}},{{v.id}},{{*value}})" src="{{images}}/quest/zvezda_{{?*value==1}}on{{?:}}off{{/?}}.gif"/>
{{?:}}
<img src="{{images}}/quest/zvezda_{{?*value<=v.cur_vote}}on{{?:}}off{{/?}}.gif"/>
{{/?}}
{{/:vote_scale_variants_zv}}
<input type="hidden" value="1" class="quest_vote_{{q.id}} vi_{{v.id}}">
{{/:vote_scale_zvezd}}

{{:cur_scale_zvezd}}
{{!for v do=@:cur_scale_variants_zv}}
{{:cur_scale_variants_zv}}
<img src="{{images}}/quest/zvezda_{{?*==0}}off{{/?}}{{?*==1}}14{{/?}}{{?*==2}}half{{/?}}{{?*==3}}34{{/?}}{{?*==4}}on{{/?}}.gif"/>
{{/:cur_scale_variants_zv}}
{{/:cur_scale_zvezd}}

{{:vote_scale_num}}
<input type="text" value="{{?v.is_voted}}{{v.cur_vote}}{{?:}}1{{/?}}" class="quest_vote_{{q.id}} vi_{{v.id}}"{{?v.is_voted}} disabled{{/?}}>
{{/:vote_scale_num}}

{{:vote_categories}}
<script type="text/javascript">
	function gol_cats(vid){
		var checks = $('input:checked.vc_'+vid);
		var vals = [];
		var i;
		for(i=0; i<checks.length; i++) {
			vals.push(checks[i].value);
		}
		document['vote_form_'+vid].vote.value = vals.join(",");
		document['vote_form_'+vid].submit();
		return false;
	}
</script>
Выбрите варианты<br>
{{!for v.variants do=@:vote_categories_variants}}
{{:vote_categories_variants}}
<input type="checkbox" class="vc_{{v.id}}" value="{{*value}}">{{*name}}<br>
{{/:vote_categories_variants}}
<a href="#" onclick="return gol_cats({{v.id}});">Проголосовать</a>&nbsp;
{{/:vote_categories}}

{{:vote_comment}}
<textarea style="width: 300px; height: 100px; border: 1px solid #000;" class="vote_comment_{{v.id}}"></textarea><br>
<a href="#{{*value}}" onclick="document.vote_form_{{v.id}}.vote.value=$('.vote_comment_{{v.id}}').val();document.vote_form_{{v.id}}.submit();return false;">Откомментироватть</a>&nbsp;
{{/:vote_comment}}
